﻿using EPiServer.Core;
using PageTypeBuilder;
using TemplateFoundation.CustomProperties;
using TemplateFoundation.Tabs;

namespace TemplateFoundation.PageTypes
{
    /// <summary>
    /// Base class for article page types, such as news articles or blog posts
    /// </summary>
    public abstract class ArticlePageBase : StandardPageBase, IArticlePage
    {
        /// <summary>
        /// Gets or sets the author of the article
        /// </summary>
        [PageTypeProperty(
            EditCaption = "Author",
            HelpText = "Person who wrote the article",
            DisplayInEditMode = true,
            UniqueValuePerLanguage = false,
            SortOrder = 100,
            Tab = typeof(RelatedTab),
            Type = typeof(PropertyContact),
            Searchable = false)]
        public override PageReference PageContact { get; set; }

        /// <summary>
        /// Gets or sets whether or not comments should be allowed for this article
        /// </summary>
        /// <remarks>This property is used when publishing through LiveWriter to enable editor to set comments policy</remarks>
        [PageTypeProperty(
            EditCaption = "Enable comments",
            HelpText = "Whether or not comments should be allowed for this article",
            DisplayInEditMode = true,
            UniqueValuePerLanguage = false,
            SortOrder = 1000,
            Tab = typeof(SettingsTab),
            Type = typeof(PropertyBoolean),
            Searchable = false)]
        public virtual bool EnableComments { get; set; }
    }
}